package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.pojo.Classes;
import com.example.pojo.ClassesCircle;
import com.example.pojo.dto.TeacherCircleDTO;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ClassCircleMapper extends MPJBaseMapper<ClassesCircle>, BaseMapper<ClassesCircle> {
    // 查询指定班级圈子中所有教师的帖子及其点赞数
    @Select("SELECT * FROM classes_circle WHERE class_id = #{classId} ORDER BY created_at DESC")
    List<ClassesCircle> selectByClassId(@Param("classId") Long classId);
}
